[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
     -n   causes perl to assume the following  loop  around  your
          script,  which makes it iterate over filename arguments
          somewhat like "sed -n" or awk:

               while (<>) {
                    ...       # your script goes here
               }

          Note that the lines are not printed by default.  See -p
          to  have  lines  printed.   Here is an efficient way to
          delete all files older than a week:

               find . -mtime +7 -print | perl -nle 'unlink;'

          This is faster than using  the  -exec  switch  of  find
          because  you  don't  have  to  start a process on every
          filename found.

See Also: -a -p
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson